import json
import sys

with open("/home/natfrp/.config/natfrp-service/config.json", "r") as user_file:
    file_contents = user_file.read()
    parsed_json = json.loads(file_contents)
    parsed_json["remote_management"] = True
    parsed_json["remote_management_key"] = sys.argv[1]
    parsed_json["token"] = sys.argv[2]
    parsed_json["webui_port"] = 14101

with open("/home/natfrp/.config/natfrp-service/config.json", "w") as user_file:
    json.dump(parsed_json, user_file, indent=4)
